#define _CRT_SECURE_NO_WARNINGS -1
#include<stdio.h>
#include<stdlib.h>

void swap(int* a, int* b)
{
	int temp = 0;
	temp = *a;
	*a = *b;
	*b = temp;
}

void sort(int* arr, int n)
{
	int begin = 0, end = n - 1;

	while (begin < end)
	{
		int max = begin;
		int min = begin;

		for (int i = begin; i <= end; i++)
		{
			if (arr[i] < arr[min])
			{
				min = i;
			}
			if (arr[i] > arr[max])
			{
				max = i;
			}
		}

		swap(&arr[begin], &arr[min]);

		if (begin == max)
		{
			max = min;
		}

		swap(&arr[end], &arr[max]);

		++begin;
		--end;
	}

}

typedef enum
{
	true = 1, false = 0
}bool;

bool isNotExist(int x, int* num, int n)
{
	for (int i = 0; i < n; i++)
	{
		if (x == num[i])
		{
			return false;
		}
	}
	return true;
}


void test()
{
	int num_1 = 0;
	scanf("%d", &num_1);
	int flag1 = num_1;
	int* num1 = (int*)malloc(sizeof(int) * num_1);
	int element = 0, i = 0;
	while (num_1 > 0)
	{
		scanf("%d", &element);
		num1[i++] = element;
		--num_1;
	}

	int num_2 = 0;
	scanf("%d", &num_2);
	int flag2 = num_2;
	int* num2 = (int*)malloc(sizeof(int) * num_2);
	int element2 = 0, i2 = 0;
	while (num_2 > 0)
	{
		scanf("%d", &element2);
		num2[i2++] = element2;
		--num_2;
	}
	sort(num1, flag1);
	for (int i = 0; i < flag1; ++i)
	{
		if (isNotExist(num1[i], num2, flag2))
		{
			printf("%d ", num1[i]);
		}
	}

	free (num1);
	free(num2);

}

//int main()
//{
//	test();
//	return 0;
//}
